package hlhj.fhp.checkpoint.presenter

import android.content.Context
import com.example.mymvp.mvp.BasePresenter
import hlhj.fhp.checkpoint.iview.HomeView
import hlhj.fhp.checkpoint.javaBean.*
import hlhj.fhp.checkpoint.module.HomeModule

/**
 * Created by Never Fear   on 2018\11\6 0006.
Never More....
 */
class HomePresenter :BasePresenter<HomeModule,HomeView>(), HomeModule.HomeResp {
    override fun bannerResp(bannerBean: BannerBean) {
        view?.setBanner(bannerBean)
    }
    //获取联系方式
    fun getContact(c:Context){
        module?.getContact(c)
    }
    override fun contactResp(serventBean: ServentBean) {
        view?.setContact(serventBean)
    }

    //违章车
    fun getCarPages(c: Context){
        module?.getCarPages(c)
    }
    override fun carPageResp(carPageBean: CarPageBean) {
        view?.setCarPages(carPageBean)
    }

    //公告
    fun getNotices(c:Context){
        module.getNotices(c)
    }
    override fun noticeResp(noticeBean: NoticeBean) {
        view?.setNotice(noticeBean)
    }

    //轮播
    fun getbanner(c:Context){
        module?.getBanner(c)
    }

    //删除
    override fun deletCar(myBaseBean: MyBaseBean) {
        view?.setDelete(myBaseBean)
    }

    fun deletCar(id:Int, c:Context){
        module?.deleteCar(id, c)
    }
    override fun createModule() {
        module=HomeModule()
        module.listener=this
    }
}